package com.dorm.cj.thread.threadGroup;

public class MyThreadGroup extends ThreadGroup {
    public MyThreadGroup(String name) {
        super(name);
    }

    /**
     * 默认 ThreadGroup uncaughtException会中断ThreadGroup所有线程
     * 如果想自定义处理，重写此方法
     *
     * @param t
     * @param e
     */
    @Override
    public void uncaughtException(Thread t, Throwable e) {
        System.out.println("MyThreadGroup uncaughtException handler");
        System.out.println(t.getName() + "throw exception :" + e.toString());
    }
}
